﻿<?php

	function convert_errorcode($value)
		{
			if($value==1)
			{
					return "Tên đăng nhập không tồn tại ";
			}	
			elseif($value==2)
			{
				return "Mật khẩu chưa chính xác";
			}
			elseif($value==4)
			{
				return "Tên không được trống";
			}
			elseif($value==5)
			{
				return "Tên nhỏ hơn 10 ký tự";
			}
			elseif($value==13)
			{
				return "Tên đã tồn tại";
			}
		}

	function bodau($txt)
	{
		$txt1 = $txt;
		$txt1 = str_replace("á", "a", $txt1);
		$txt1 = str_replace("à", "a", $txt1);
		$txt1 = str_replace("ả", "a", $txt1);
		$txt1 = str_replace("ã", "a", $txt1);
		$txt1 = str_replace("ạ", "a", $txt1);

		$txt1 = str_replace("ă", "a", $txt1);
		$txt1 = str_replace("ằ", "a", $txt1);
		$txt1 = str_replace("ắ", "a", $txt1);
		$txt1 = str_replace("ẳ", "a", $txt1);
		$txt1 = str_replace("ẵ", "a", $txt1);
		$txt1 = str_replace("ặ", "a", $txt1);

		$txt1 = str_replace("â", "a", $txt1);
		$txt1 = str_replace("ầ", "a", $txt1);
		$txt1 = str_replace("ấ", "a", $txt1);
		$txt1 = str_replace("ẩ", "a", $txt1);
		$txt1 = str_replace("ẫ", "a", $txt1);
		$txt1 = str_replace("ậ", "a", $txt1);

		$txt1 = str_replace("đ", "d", $txt1);

		$txt1 = str_replace("è", "e", $txt1);
		$txt1 = str_replace("é", "e", $txt1);
		$txt1 = str_replace("ẻ", "e", $txt1);
		$txt1 = str_replace("ẽ", "e", $txt1);
		$txt1 = str_replace("ẹ", "e", $txt1);

		$txt1 = str_replace("ê", "e", $txt1);
		$txt1 = str_replace("ề", "e", $txt1);
		$txt1 = str_replace("ế", "e", $txt1);
		$txt1 = str_replace("ể", "e", $txt1);
		$txt1 = str_replace("ễ", "e", $txt1);
		$txt1 = str_replace("ệ", "e", $txt1);

		$txt1 = str_replace("ì", "i", $txt1);
		$txt1 = str_replace("í", "i", $txt1);
		$txt1 = str_replace("ỉ", "i", $txt1);
		$txt1 = str_replace("ĩ", "i", $txt1);
		$txt1 = str_replace("ị", "i", $txt1);

		$txt1 = str_replace("ò", "o", $txt1);
		$txt1 = str_replace("ó", "o", $txt1);
		$txt1 = str_replace("ỏ", "o", $txt1);
		$txt1 = str_replace("õ", "o", $txt1);
		$txt1 = str_replace("ọ", "o", $txt1);

		$txt1 = str_replace("ô", "o", $txt1);
		$txt1 = str_replace("ồ", "o", $txt1);
		$txt1 = str_replace("ố", "o", $txt1);
		$txt1 = str_replace("ổ", "o", $txt1);
		$txt1 = str_replace("ỗ", "o", $txt1);
		$txt1 = str_replace("ộ", "o", $txt1);

		$txt1 = str_replace("ơ", "o", $txt1);
		$txt1 = str_replace("ờ", "o", $txt1);
		$txt1 = str_replace("ớ", "o", $txt1);
		$txt1 = str_replace("ở", "o", $txt1);
		$txt1 = str_replace("ỡ", "o", $txt1);
		$txt1 = str_replace("ợ", "o", $txt1);

		$txt1 = str_replace("ù", "u", $txt1);
		$txt1 = str_replace("ú", "u", $txt1);
		$txt1 = str_replace("ủ", "u", $txt1);
		$txt1 = str_replace("ũ", "u", $txt1);
		$txt1 = str_replace("ụ", "u", $txt1);

		$txt1 = str_replace("ư", "u", $txt1);
		$txt1 = str_replace("ừ", "u", $txt1);
		$txt1 = str_replace("ứ", "u", $txt1);
		$txt1 = str_replace("ử", "u", $txt1);
		$txt1 = str_replace("ữ", "u", $txt1);
		$txt1 = str_replace("ự", "u", $txt1);

		$txt1 = str_replace("ỳ", "y", $txt1);
		$txt1 = str_replace("ý", "y", $txt1);
		$txt1 = str_replace("ỷ", "y", $txt1);
		$txt1 = str_replace("ỹ", "y", $txt1);
		$txt1 = str_replace("ỵ", "y", $txt1);


		$txt1 = str_replace("Á", "A", $txt1);
		$txt1 = str_replace("À", "A", $txt1);
		$txt1 = str_replace("Ả", "A", $txt1);
		$txt1 = str_replace("Ã", "A", $txt1);
		$txt1 = str_replace("Ạ", "A", $txt1);

		$txt1 = str_replace("Ă", "A", $txt1);
		$txt1 = str_replace("Ằ", "A", $txt1);
		$txt1 = str_replace("Ắ", "A", $txt1);
		$txt1 = str_replace("Ẳ", "A", $txt1);
		$txt1 = str_replace("Ẵ", "A", $txt1);
		$txt1 = str_replace("Ặ", "A", $txt1);

		$txt1 = str_replace("Â", "A", $txt1);
		$txt1 = str_replace("Ầ", "A", $txt1);
		$txt1 = str_replace("Ấ", "A", $txt1);
		$txt1 = str_replace("Ẩ", "A", $txt1);
		$txt1 = str_replace("Ẫ", "A", $txt1);
		$txt1 = str_replace("Ậ", "A", $txt1);

		$txt1 = str_replace("Đ", "D", $txt1);

		$txt1 = str_replace("È", "E", $txt1);
		$txt1 = str_replace("É", "E", $txt1);
		$txt1 = str_replace("Ẻ", "E", $txt1);
		$txt1 = str_replace("Ẽ", "E", $txt1);
		$txt1 = str_replace("Ẹ", "E", $txt1);

		$txt1 = str_replace("Ê", "E", $txt1);
		$txt1 = str_replace("Ề", "E", $txt1);
		$txt1 = str_replace("Ế", "E", $txt1);
		$txt1 = str_replace("Ể", "E", $txt1);
		$txt1 = str_replace("Ễ", "E", $txt1);
		$txt1 = str_replace("Ệ", "E", $txt1);

		$txt1 = str_replace("Ì", "I", $txt1);
		$txt1 = str_replace("Í", "I", $txt1);
		$txt1 = str_replace("Ỉ", "I", $txt1);
		$txt1 = str_replace("Ĩ", "I", $txt1);
		$txt1 = str_replace("Ị", "I", $txt1);

		$txt1 = str_replace("Ò", "O", $txt1);
		$txt1 = str_replace("Ó", "O", $txt1);
		$txt1 = str_replace("Ỏ", "O", $txt1);
		$txt1 = str_replace("Õ", "O", $txt1);
		$txt1 = str_replace("Ọ", "O", $txt1);

		$txt1 = str_replace("Ô", "O", $txt1);
		$txt1 = str_replace("Ồ", "O", $txt1);
		$txt1 = str_replace("Ố", "O", $txt1);
		$txt1 = str_replace("Ổ", "O", $txt1);
		$txt1 = str_replace("Ỗ", "O", $txt1);
		$txt1 = str_replace("Ộ", "O", $txt1);

		$txt1 = str_replace("Ơ", "O", $txt1);
		$txt1 = str_replace("Ờ", "O", $txt1);
		$txt1 = str_replace("Ớ", "O", $txt1);
		$txt1 = str_replace("Ở", "O", $txt1);
		$txt1 = str_replace("Ỡ", "O", $txt1);
		$txt1 = str_replace("Ợ", "O", $txt1);

		$txt1 = str_replace("Ù", "U", $txt1);
		$txt1 = str_replace("Ú", "U", $txt1);
		$txt1 = str_replace("Ủ", "U", $txt1);
		$txt1 = str_replace("Ũ", "U", $txt1);
		$txt1 = str_replace("Ụ", "U", $txt1);

		$txt1 = str_replace("Ư", "U", $txt1);
		$txt1 = str_replace("Ừ", "U", $txt1);
		$txt1 = str_replace("Ứ", "U", $txt1);
		$txt1 = str_replace("Ử", "U", $txt1);
		$txt1 = str_replace("Ữ", "U", $txt1);
		$txt1 = str_replace("Ự", "U", $txt1);

		$txt1 = str_replace("Ỳ", "Y", $txt1);
		$txt1 = str_replace("Ý", "Y", $txt1);
		$txt1 = str_replace("Ỷ", "Y", $txt1);
		$txt1 = str_replace("Ỹ", "Y", $txt1);
		$txt1 = str_replace("Ỵ", "Y", $txt1);
		return $txt1;
	}

	function chuthuong($txt)
	{
		$txt1 = $txt;

		$txt1 = str_replace("Á", "á", $txt1);
		$txt1 = str_replace("À", "à", $txt1);
		$txt1 = str_replace("Ả", "ả", $txt1);
		$txt1 = str_replace("Ã", "ã", $txt1);
		$txt1 = str_replace("Ạ", "ạ", $txt1);

		$txt1 = str_replace("Ă", "ă", $txt1);
		$txt1 = str_replace("Ằ", "ằ", $txt1);
		$txt1 = str_replace("Ắ", "ắ", $txt1);
		$txt1 = str_replace("Ẳ", "ẳ", $txt1);
		$txt1 = str_replace("Ẵ", "ẵ", $txt1);
		$txt1 = str_replace("Ặ", "ặ", $txt1);

		$txt1 = str_replace("Â", "â", $txt1);
		$txt1 = str_replace("Ầ", "ầ", $txt1);
		$txt1 = str_replace("Ấ", "ấ", $txt1);
		$txt1 = str_replace("Ẩ", "ẩ", $txt1);
		$txt1 = str_replace("Ẫ", "ẫ", $txt1);
		$txt1 = str_replace("Ậ", "ậ", $txt1);

		$txt1 = str_replace("Đ", "đ", $txt1);

		$txt1 = str_replace("È", "è", $txt1);
		$txt1 = str_replace("É", "é", $txt1);
		$txt1 = str_replace("Ẻ", "ẻ", $txt1);
		$txt1 = str_replace("Ẽ", "ẽ", $txt1);
		$txt1 = str_replace("Ẹ", "ẹ", $txt1);

		$txt1 = str_replace("Ê", "ê", $txt1);
		$txt1 = str_replace("Ề", "ề", $txt1);
		$txt1 = str_replace("Ế", "ế", $txt1);
		$txt1 = str_replace("Ể", "ể", $txt1);
		$txt1 = str_replace("Ễ", "ễ", $txt1);
		$txt1 = str_replace("Ệ", "ệ", $txt1);

		$txt1 = str_replace("Ì", "ì", $txt1);
		$txt1 = str_replace("Í", "í", $txt1);
		$txt1 = str_replace("Ỉ", "ỉ", $txt1);
		$txt1 = str_replace("Ĩ", "ĩ", $txt1);
		$txt1 = str_replace("Ị", "ị", $txt1);

		$txt1 = str_replace("Ò", "ò", $txt1);
		$txt1 = str_replace("Ó", "ó", $txt1);
		$txt1 = str_replace("Ỏ", "ỏ", $txt1);
		$txt1 = str_replace("Õ", "õ", $txt1);
		$txt1 = str_replace("Ọ", "ọ", $txt1);

		$txt1 = str_replace("Ô", "ô", $txt1);
		$txt1 = str_replace("Ồ", "ồ", $txt1);
		$txt1 = str_replace("Ố", "ố", $txt1);
		$txt1 = str_replace("Ổ", "ổ", $txt1);
		$txt1 = str_replace("Ỗ", "ỗ", $txt1);
		$txt1 = str_replace("Ộ", "ộ", $txt1);

		$txt1 = str_replace("Ơ", "ơ", $txt1);
		$txt1 = str_replace("Ờ", "ờ", $txt1);
		$txt1 = str_replace("Ớ", "ớ", $txt1);
		$txt1 = str_replace("Ở", "ở", $txt1);
		$txt1 = str_replace("Ỡ", "ỡ", $txt1);
		$txt1 = str_replace("Ợ", "ợ", $txt1);

		$txt1 = str_replace("Ù", "ù", $txt1);
		$txt1 = str_replace("Ú", "ú", $txt1);
		$txt1 = str_replace("Ủ", "ủ", $txt1);
		$txt1 = str_replace("Ũ", "ũ", $txt1);
		$txt1 = str_replace("Ụ", "ụ", $txt1);

		$txt1 = str_replace("Ư", "ư", $txt1);
		$txt1 = str_replace("Ừ", "ừ", $txt1);
		$txt1 = str_replace("Ứ", "ứ", $txt1);
		$txt1 = str_replace("Ử", "ử", $txt1);
		$txt1 = str_replace("Ữ", "ữ", $txt1);
		$txt1 = str_replace("Ự", "ự", $txt1);

		$txt1 = str_replace("Ỳ", "ỳ", $txt1);
		$txt1 = str_replace("Ý", "ý", $txt1);
		$txt1 = str_replace("Ỷ", "ỷ", $txt1);
		$txt1 = str_replace("Ỹ", "ỹ", $txt1);
		$txt1 = str_replace("Ỵ", "ỵ", $txt1);

		$txt1 = str_replace("A", "a", $txt1);
		$txt1 = str_replace("B", "b", $txt1);
		$txt1 = str_replace("C", "c", $txt1);
		$txt1 = str_replace("D", "d", $txt1);
		$txt1 = str_replace("E", "e", $txt1);
		$txt1 = str_replace("F", "f", $txt1);
		$txt1 = str_replace("G", "g", $txt1);
		$txt1 = str_replace("H", "h", $txt1);
		$txt1 = str_replace("I", "i", $txt1);
		$txt1 = str_replace("J", "j", $txt1);
		$txt1 = str_replace("K", "k", $txt1);
		$txt1 = str_replace("L", "l", $txt1);
		$txt1 = str_replace("M", "m", $txt1);
		$txt1 = str_replace("N", "n", $txt1);
		$txt1 = str_replace("O", "o", $txt1);
		$txt1 = str_replace("P", "p", $txt1);
		$txt1 = str_replace("Q", "q", $txt1);
		$txt1 = str_replace("R", "r", $txt1);
		$txt1 = str_replace("S", "s", $txt1);
		$txt1 = str_replace("T", "t", $txt1);
		$txt1 = str_replace("U", "u", $txt1);
		$txt1 = str_replace("V", "v", $txt1);
		$txt1 = str_replace("W", "w", $txt1);
		$txt1 = str_replace("X", "x", $txt1);
		$txt1 = str_replace("Y", "y", $txt1);
		$txt1 = str_replace("Z", "z", $txt1);

		return $txt1;
	}

	function chuhoa($txt)
	{
		$txt1 = $txt;

		$txt1 = str_replace("á", "Á", $txt1);
		$txt1 = str_replace("à", "À", $txt1);
		$txt1 = str_replace("ả", "Ả", $txt1);
		$txt1 = str_replace("ã", "Ã", $txt1);
		$txt1 = str_replace("ạ", "Ạ", $txt1);

		$txt1 = str_replace("ă", "Ă", $txt1);
		$txt1 = str_replace("ằ", "Ằ", $txt1);
		$txt1 = str_replace("ắ", "Ắ", $txt1);
		$txt1 = str_replace("ẳ", "Ẳ", $txt1);
		$txt1 = str_replace("ẵ", "Ẵ", $txt1);
		$txt1 = str_replace("ặ", "Ặ", $txt1);

		$txt1 = str_replace("â", "Â", $txt1);
		$txt1 = str_replace("ầ", "Ầ", $txt1);
		$txt1 = str_replace("ấ", "Ấ", $txt1);
		$txt1 = str_replace("ẩ", "Ẩ", $txt1);
		$txt1 = str_replace("ẫ", "Ẫ", $txt1);
		$txt1 = str_replace("ậ", "Ậ", $txt1);

		$txt1 = str_replace("đ", "Đ", $txt1);

		$txt1 = str_replace("è", "È", $txt1);
		$txt1 = str_replace("é", "É", $txt1);
		$txt1 = str_replace("ẻ", "Ẻ", $txt1);
		$txt1 = str_replace("ẽ", "Ẽ", $txt1);
		$txt1 = str_replace("ẹ", "Ẹ", $txt1);

		$txt1 = str_replace("ê", "Ê", $txt1);
		$txt1 = str_replace("ề", "Ề", $txt1);
		$txt1 = str_replace("ế", "Ế", $txt1);
		$txt1 = str_replace("ể", "Ể", $txt1);
		$txt1 = str_replace("ễ", "Ễ", $txt1);
		$txt1 = str_replace("ệ", "Ệ", $txt1);

		$txt1 = str_replace("ì", "Ì", $txt1);
		$txt1 = str_replace("í", "Í", $txt1);
		$txt1 = str_replace("ỉ", "Ỉ", $txt1);
		$txt1 = str_replace("ĩ", "Ĩ", $txt1);
		$txt1 = str_replace("ị", "Ị", $txt1);

		$txt1 = str_replace("ò", "Ò", $txt1);
		$txt1 = str_replace("ó", "Ó", $txt1);
		$txt1 = str_replace("ỏ", "Ỏ", $txt1);
		$txt1 = str_replace("õ", "Õ", $txt1);
		$txt1 = str_replace("ọ", "Ọ", $txt1);

		$txt1 = str_replace("ô", "Ô", $txt1);
		$txt1 = str_replace("ồ", "Ồ", $txt1);
		$txt1 = str_replace("ố", "Ố", $txt1);
		$txt1 = str_replace("ổ", "Ổ", $txt1);
		$txt1 = str_replace("ỗ", "Ỗ", $txt1);
		$txt1 = str_replace("ộ", "Ộ", $txt1);

		$txt1 = str_replace("ơ", "Ơ", $txt1);
		$txt1 = str_replace("ờ", "Ờ", $txt1);
		$txt1 = str_replace("ớ", "Ớ", $txt1);
		$txt1 = str_replace("ở", "Ở", $txt1);
		$txt1 = str_replace("ỡ", "Ỡ", $txt1);
		$txt1 = str_replace("ợ", "Ợ", $txt1);

		$txt1 = str_replace("ù", "Ù", $txt1);
		$txt1 = str_replace("ú", "Ú", $txt1);
		$txt1 = str_replace("ủ", "Ủ", $txt1);
		$txt1 = str_replace("ũ", "Ũ", $txt1);
		$txt1 = str_replace("ụ", "Ụ", $txt1);

		$txt1 = str_replace("ư", "Ư", $txt1);
		$txt1 = str_replace("ừ", "Ừ", $txt1);
		$txt1 = str_replace("ứ", "Ứ", $txt1);
		$txt1 = str_replace("ử", "Ử", $txt1);
		$txt1 = str_replace("ữ", "Ữ", $txt1);
		$txt1 = str_replace("ự", "Ự", $txt1);

		$txt1 = str_replace("ỳ", "Ỳ", $txt1);
		$txt1 = str_replace("ý", "Ý", $txt1);
		$txt1 = str_replace("ỷ", "Ỷ", $txt1);
		$txt1 = str_replace("ỹ", "Ỹ", $txt1);
		$txt1 = str_replace("ỵ", "Ỵ", $txt1);

		$txt1 = str_replace("a", "A", $txt1);
		$txt1 = str_replace("b", "B", $txt1);
		$txt1 = str_replace("c", "C", $txt1);
		$txt1 = str_replace("d", "D", $txt1);
		$txt1 = str_replace("e", "E", $txt1);
		$txt1 = str_replace("f", "F", $txt1);
		$txt1 = str_replace("g", "G", $txt1);
		$txt1 = str_replace("h", "H", $txt1);
		$txt1 = str_replace("i", "I", $txt1);
		$txt1 = str_replace("j", "J", $txt1);
		$txt1 = str_replace("k", "K", $txt1);
		$txt1 = str_replace("l", "L", $txt1);
		$txt1 = str_replace("m", "M", $txt1);
		$txt1 = str_replace("n", "N", $txt1);
		$txt1 = str_replace("o", "O", $txt1);
		$txt1 = str_replace("p", "P", $txt1);
		$txt1 = str_replace("q", "Q", $txt1);
		$txt1 = str_replace("r", "R", $txt1);
		$txt1 = str_replace("s", "S", $txt1);
		$txt1 = str_replace("t", "T", $txt1);
		$txt1 = str_replace("u", "U", $txt1);
		$txt1 = str_replace("v", "V", $txt1);
		$txt1 = str_replace("w", "W", $txt1);
		$txt1 = str_replace("x", "X", $txt1);
		$txt1 = str_replace("y", "Y", $txt1);
		$txt1 = str_replace("z", "Z", $txt1);

		return $txt1;
	}

	function format_phone($phone)
	{
		if (strlen($phone) < 9) {
			return substr_replace($phone, '****', 2, 4);
		} elseif (strlen($phone) == 10) {
			return substr_replace($phone, '****', 3, 4);
		} else {
			return substr_replace($phone, '****', 4, 4);
		}
	}

	function kill_special($value)
	{
		return preg_replace('/[^\w\d_ -]/si', '', $value);
	}

	function truncate_string($string, $max_length)
	{
		if (mb_strlen($string, 'UTF-8') > $max_length) {
			$string = mb_substr($string, 0, $max_length, 'UTF-8');
			$pos = mb_strrpos($string, ' ', false, 'UTF-8');
			if ($pos === false) {
				return mb_substr($string, 0, $max_length, 'UTF-8') . '…';
			}
			return mb_substr($string, 0, $pos, 'UTF-8') . '…';
		} else {
			return $string;
		}
	}

	function datetime_to_unix($datetime)
	{
		list($date, $time) = explode(' ', $datetime);
		list($day, $month, $year) = explode('/', $date);
		list($hour, $minute, $second) = explode(':', $time);
		return mktime($hour, $minute, $second, $month, $day, $year);
	}

	function mysql_datetime($timestamp = null)
	{
		if (!isset($timestamp)) $timestamp = time();
		return date('Y-m-d H:i:s', $timestamp);
	}

	function stripHTMLtags($str)
	{
		$t = preg_replace('/<[^<|>]+?>/', '', $str);
		//$t = htmlentities($t, ENT_QUOTES);
		return $t;
	}

	function humanTiming($time)
	{

		$time = time() - $time; // to get the time since that moment

		$tokens = array(
			31536000 => 'năm',
			2592000 => 'tháng',
			604800 => 'tuần',
			86400 => 'ngày',
			3600 => 'giờ',
			60 => 'phút',
			1 => 'giây'
			);

		foreach ($tokens as $unit => $text) {
			if ($time < $unit) continue;
			$numberOfUnits = floor($time / $unit);
			return $numberOfUnits . ' ' . $text . (($numberOfUnits > 1) ? '' : '');
		}

	}

	function getHighlight(){
		$ci =& get_instance();
		$q = $ci->db->select("*",FALSE)
			->from("setting_msg")
			->where('m_status',1);
		$tmp = $q->get()->result();
		$return = "";
		foreach($tmp as $row){
			if($row != ""){
				$return .= '<li><a href="'.$row->link.'">'.$row->msg.'</a></li>';
			} else {
				$return .= '<li>'.$row->msg.'</li>';
			}
		}
		return $return;
	}
	function birthDropdown($startTime, $endTime, $id="year", $selected=0, $label = ""){
		//start the select tag
		echo "<select id=".$id." name=".$id." class='birthday'>";
		echo "<option value=''>".$label."</option>";
		//echo each year as an option
		for ($i=$endTime;$i>=$startTime;$i--){
			if($i==$selected){
				echo "<option value=".$i." selected>".$i."</option>";
			} else {
				echo "<option value=".$i.">".$i."</option>";
			}
		}

		//close the select tag
		echo "</select>";
	}
	function getLoginGame($login_ip, $pid, $uid, $uname){
		//$a =  date('YmdHis',strtotime('+8 hours'));
		$a = date('YmdHis',strtotime('+1 minutes'));
		$loginkey = "dgspjfdFfdsR234F433sdr3rd2d3f5sa43";
		$sign = md5($uid.$uname.$a.$pid.$loginkey);
		$http = $login_ip;
		$url = $http.'Interfaces/login_partner.aspx?uid='.$uid.'&uname='.$uname.'&ulgtime='.$a . '&pid=' . $pid.'&sign='.$sign;
		return $url;
	}
	function check_login($domain,$pid) {
		session_start(); 
	//	print_r("test1.".$_SESSION['user_data']);die;
		$CI =& get_instance();
		if($_SESSION['user_data']== ""){
			$uri = base_url();
		} else {
			$user = $_SESSION['user_data'];
			$url = 'http://'.$domain.'.linhvuong.slg.vn/';
			$uri = getLoginGame($url, $pid, $user->uid, $user->name);
			//$uri = "http://linhvuong.slg.vn/home/dang-xuat/"; // khi nao ok thi them dau // vao truoc $uri o dong nay
		}

		return $uri;
	}
	function format_price($price){
		return $price/100;
	}
	function format_amount($price){
		return $price/10000;
	}

	/*
	function format_price($price){
	    switch($price){
	        case 10000:
	            return 100;
	            break;
	        case 20000:
	            return 200;
	            break;
	        case 30000:
	            return 300;
	            break;
	        case 50000:
	            return 500;
	            break;
	        case 100000:
	            return 1000;
	            break;
	        case 200000:
	            return 2000;
	            break;
	        case 300000:
	            return 3000;
	            break;
	        case 500000:
	            return 5000;
	            break;
	        default:
	            return 100;
	            break;
	    }
	}
	function format_amount($price){
	    switch($price){
	        case 10000:
	            return 1;
	            break;
	        case 20000:
	            return 2;
	            break;
	        case 30000:
	            return 3;
	            break;
	        case 50000:
	            return 5;
	            break;
	        case 100000:
	            return 10;
	            break;
	        case 200000:
	            return 20;
	            break;
	        case 300000:
	            return 30;
	            break;
	        case 500000:
	            return 50;
	            break;
	        default:
	            return 1;
	            break;
	    }
	}
*/